@model CreateTypeViewModel

<h1>@RenderTitleSegments(T["New Content Type"])</h1>

<form asp-action="Create">
    @Html.ValidationSummary()

    <fieldset class="form-group row">
        <div class="col-md">
            <label asp-for="DisplayName">@T["Display Name"]</label>
            <input asp-for="DisplayName" class="form-control" autofocus/>
            <span class="hint">@T["Name of the type as it will be displayed in screens."]</span>
        </div>
    </fieldset>

    <fieldset class="form-group row">
        <div class="col-sm">
            <label asp-for="Name">@T["Technical Name"]</label>
            <input asp-for="Name" class="form-control" />
            <span class="hint">@T["Technical name of the type."]</span>
        </div>
    </fieldset>

    <fieldset class="form-group">
        <button class="btn btn-primary" type="submit">@T["Create"]</button>
    </fieldset>
</form>

<script at="Foot" type="text/javascript">
//<![CDATA[
    $(function(){
        var $name = $("#@Html.IdFor(m => m.Name)");
        var $displayName = $("#@Html.IdFor(m => m.DisplayName)");

        var nameAltered;
        $name.keypress(function() {
            nameAltered = true;
        });

        var compute = function() {
            // stop processing automatically if altered by the user
            if(nameAltered) {
                return true;
            }

            $name.val(getTechnicalName($displayName.val()));
        };

        $displayName.keyup(compute);
        $displayName.blur(compute);
    })
//]]>
</script>
